package cn.iocoder.yudao.module.shop.dal.mysql.jiucase;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.shop.dal.dataobject.jiucase.ShopJiuCaseDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.shop.controller.admin.jiucase.vo.*;

/**
 * 店铺灸法案例 Mapper
 *
 * @author 曹建伟
 */
@Mapper
public interface ShopJiuCaseMapper extends BaseMapperX<ShopJiuCaseDO> {

    default PageResult<ShopJiuCaseDO> selectPage(ShopJiuCasePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopJiuCaseDO>()
                .eqIfPresent(ShopJiuCaseDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(ShopJiuCaseDO::getTimes, reqVO.getTimes())
                .eqIfPresent(ShopJiuCaseDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(ShopJiuCaseDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopJiuCaseDO::getId));
    }

    default List<ShopJiuCaseDO> selectList(ShopJiuCaseExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopJiuCaseDO>()
                .eqIfPresent(ShopJiuCaseDO::getMemberId, reqVO.getMemberId())
                .eqIfPresent(ShopJiuCaseDO::getUserId, reqVO.getUserId())
                .betweenIfPresent(ShopJiuCaseDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ShopJiuCaseDO::getId));
    }

}
